package com.wl.cloud.security.exception;

import com.wl.cloud.core.enums.ErrorCode;
import com.wl.cloud.core.exception.CustomException;

/**
 * @author: wanglin
 * @date: 2023-10-25 周三
 * @Version: 1.0
 * @Description:
 */
public class SecurityException extends CustomException {
    private static final long serialVersionUID = -4138013499105708265L;

    public SecurityException() {
    }

    public SecurityException(String msg) {
        super(msg);
    }

    public SecurityException(ErrorCode errorCode, String message) {
        super(errorCode, message);
    }

    public static SecurityException asSecurityException(String message) {
        return new SecurityException(message);
    }

    public static CustomException asInvalidTokenException() {
        return CustomException.asCustomException("无效token，请重新登录！");
    }

    public static CustomException asInvalidTokenException(String msg) {
        return CustomException.asCustomException(msg);
    }
}
